package com.sea.base.ext.global

import android.content.Context
import android.content.res.ColorStateList
import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat

@get:ColorInt
inline val Int.toColorInt
    get() = this.toColorInt()

inline val Int.colorResToColorStateList
    get() = ColorStateList.valueOf(this.toColorInt)

inline val Int.colorIntToColorStateList
    get() = ColorStateList.valueOf(this)

@ColorInt
@JvmOverloads
@Suppress("NOTHING_TO_INLINE")
inline fun Int.toColorInt(context: Context = singleApplication) =
    ContextCompat.getColor(context, this)